package com.futao.service;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * @author futao
 * Created on 18-6-7-下午7:06.
 */
@Component
public class GetSession {

    @Autowired
    @Qualifier("sessionFactory")
    private SessionFactory sessionFactory;


    public Session getSession() {
        return this.sessionFactory.getCurrentSession();
    }
}
